package com.ojoin.trade.supplyloan_core.web.dao;

import com.ojoin.trade.common.exception.BusinessException;
import com.ojoin.trade.common.web.dao.BaseDao;
import com.ojoin.trade.supplyloan_core.web.domain.*;

import java.util.List;
import java.util.Map;

import org.springframework.data.domain.Pageable;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 15-10-22
 * Time: 上午10:43
 * To change this template use File | Settings | File Templates.
 */
public interface TbSlLoanApplicationDao extends BaseDao<TbSlLoanApplication> {
    
    public List<TbSlLoanApplicationInfoVO> queryAllTbSlApplication()throws BusinessException;

    public TbSlLoanApplication queryTbSlApplicationByJoinId(int id_of_tb_merchant_user)throws BusinessException;
 
    public void update(Map<String,Object> parammap)throws BusinessException; 
    
    /**
   	 * 根据 update by primaryId and joinid 
   	 * @return
   	 * @throws BusinessException
   	 */ 
    
   	public int updateByPrimaryIdAndJoinid(TbSlLoanApplication tbsl) throws BusinessException;
   	
   	
    /**
	 * 查询后台管理员代办任务列表
	 * @return
	 * @throws BusinessException
	 */
	public List<TbSLLoanTodoTaskVO> queryAdminUserTodoTaskList() throws BusinessException;
	
	/**
	 * 查询保理员代办任务列表
	 * @return
	 * @throws BusinessException
	 */
	public List<TbSLLoanTodoTaskVO> queryOperatorTodoTaskList() throws BusinessException;
	
	/**
	 * 根据状态查询供应链贷申请记录
	 * @param loanstatus
	 * @return
	 * @throws BusinessException
	 */
	public List<TbSlLoanApplicationInfoVO> querySLLoanAppInfoListByStatus(
			int loanstatus, Pageable page) throws BusinessException;
	
	public List<TbSlLoanApplicationInfoVO> queryCreditedSLLoanAppInfoList(
			int loanstatus, Pageable page) throws BusinessException;
    
	public List<TbSlLoanApplicationStatVO> querySlLoanApplyStatListByStatus(
			int loanstatus, int joinuserid, Pageable page) throws BusinessException;
	
	
	/**
	 * 根据九盈用户更新申请记录
	 * @param tbsl
	 * @return
	 * @throws BusinessException
	 */
	public int updateByJoinid(TbSlLoanApplication tbsl)
			throws BusinessException;

    public String queryMerNameByJoinid(int id)throws BusinessException;

    public List<TbSlLoanApplicationInfoVO> queryNeedMessage()throws BusinessException;
	
    public String querySLLoanAppProcInstIdById(int id) throws BusinessException;

    public List<TbApplicationExpireVo> queryTbApplicationExpireVo(Pageable page)throws BusinessException;
    
}

